Arrow keys / Click to navigate

Module 13: Architecting for the Edge

Advanced Architecting on AWS

CloudFront โ€ข Lambda@Edge โ€ข Local Zones โ€ข Wavelength โ€ข IoT

๐ŸŽฏ Module Objectives

๐ŸŒ Amazon CloudFront

OAC vs. OAI: OAC is the modern replacement โ€” supports SSE-KMS, all S3 features, and is recommended for all new distributions. OAI is legacy.

โšก CloudFront Functions vs. Lambda@Edge

FeatureCloudFront FunctionsLambda@Edge
RuntimeJavaScript onlyNode.js, Python
Execution time<1 msUp to 5s (viewer) / 30s (origin)
Memory2 MB128โ€“10,240 MB
Network accessNoYes
Trigger pointsViewer request/response onlyAll 4 trigger points
ScaleMillions of RPSThousands of RPS
Use caseURL rewrites, header manipulation, redirectsA/B testing, auth, image resize, origin selection
Cost1/6th the cost of Lambda@EdgeHigher (Lambda pricing)

๐Ÿ“ Local Zones & Wavelength

Local Zones

AWS infrastructure in metropolitan areas. Single-digit ms latency to nearby users. EC2, EBS, ECS, EKS available. Connected to parent Region.

Wavelength Zones

AWS compute inside 5G telecom networks. Ultra-low latency for mobile/IoT. EC2, EBS available. Accessed via carrier gateway.

๐ŸŒฟ AWS IoT Greengrass

Greengrass positioning: For IoT edge processing (sensors, industrial). Outposts for enterprise server workloads. Local Zones for user-facing low-latency apps. Each solves a different "edge" problem.

๐Ÿ’ป Demo: CloudFront with OAC

# Create Origin Access Control
aws cloudfront create-origin-access-control \
  --origin-access-control-config '{"Name":"MyOAC",
    "SigningProtocol":"sigv4","SigningBehavior":"always",
    "OriginAccessControlOriginType":"s3"}'

# Create CloudFront invalidation
aws cloudfront create-invalidation \
  --distribution-id E1234567890 \
  --paths "/*"

# List CloudFront distributions
aws cloudfront list-distributions \
  --query 'DistributionList.Items[].{Id:Id,Domain:DomainName,Status:Status}'

๐Ÿงช Knowledge Check

Q1: A website needs to add security headers (X-Frame-Options, CSP) to all responses at minimal cost and maximum scale. What should they use?

A) Lambda@Edge viewer response   B) CloudFront Functions viewer response   C) ALB response headers   D) WAF custom rules

B) CloudFront Functions viewer response โ€” Adding static headers is a simple, lightweight operation perfect for CF Functions (sub-ms execution, 1/6th cost of Lambda@Edge, scales to millions of RPS). No network access needed.

Q2: A mobile gaming company needs <5ms latency for players connected via 5G networks. Which AWS service should they use?

A) CloudFront   B) Local Zones   C) Wavelength Zones   D) Global Accelerator

C) Wavelength Zones โ€” Wavelength embeds compute within 5G carrier networks, providing ultra-low latency (<5ms) for mobile users. Traffic never leaves the carrier network for the compute hop.

๐Ÿ“ Module 13 Summary

CloudFront

600+ PoPs. Behaviors for path routing. OAC (not OAI). Cache/Origin request policies. Origin failover.

Edge Compute

CF Functions (simple, fast, cheap). Lambda@Edge (complex, network access). Choose by complexity.

Extended Infrastructure

Local Zones (metro low-latency). Wavelength (5G). Outposts (on-premises). IoT Greengrass (devices).

Decision Guide

Web content โ†’ CloudFront. Metro apps โ†’ Local Zones. 5G mobile โ†’ Wavelength. Data center โ†’ Outposts.

Click anywhere to close